import axios from '@/libs/api.request'

// 登录
export const login = ({
  userName,
  password
}) => {
  const data = {
    userName,
    password
  }
  return axios.request({
    url: 'Login/SubmitLogin',
    data,
    method: 'post'
  })
}

// 根据角色获取菜单列表
export const GetRoleBySysUserMenuLists = (data) => {
  return axios.request({
    url: 'SysUserMenu/GetRoleBySysUserMenu',
    data,
    method: 'post'
  })
}

// 添加/修改系统用户
export const editSystemUser = (data) => {
  return axios.request({
    url: 'SysUser/EditSysUserModel',
    data,
    method: 'post'
  })
}
// 获取系统用户详情
export const getSystemUserDetail = (data) => {
  return axios.request({
    url: 'SysUser/GetSysUserModel',
    data,
    method: 'post'
  })
}
// 删除系统用户
export const delSystemUser = (data) => {
  return axios.request({
    url: 'SysUser/DeleteSysUserModel',
    data,
    method: 'post'
  })
}

// 添加/修改角色
export const editSystemUserType = (data) => {
  return axios.request({
    url: 'SysUserType/EditSysUserType',
    data,
    method: 'post'
  })
}
// 获取角色用户详情
export const getSystemUserTypeDetail = (data) => {
  return axios.request({
    url: 'SysUserType/GetUserTypeModel',
    data,
    method: 'post'
  })
}
// 删除角色用户
export const delSystemUserType = (data) => {
  return axios.request({
    url: 'SysUserType/DeleteSysUserType',
    data,
    method: 'post'
  })
}

// 获取app用户详情
export const getUserDetail = (data) => {
  return axios.request({
    url: 'User/GetUserModel',
    data,
    method: 'post'
  })
}
// 修改app用户信息
export const editUserDetail = (data) => {
  return axios.request({
    url: 'User/UpdataUserModel',
    data,
    method: 'post'
  })
}
// 获取用户奖励额列表
export const getUserbonusList = (data) => {
  return axios.request({
    url: 'RewardQuotaDetail/GetPageList',
    data,
    method: 'post'
  })
}
// 获取用户消费积分列表
export const getUserintegralList = (data) => {
  return axios.request({
    url: 'UserIntegralDetail/GetPageList',
    data,
    method: 'post'
  })
}
// 赠送/索回用户积分
export const editUserintegral = (data) => {
  return axios.request({
    url: 'UserIntegralDetail/EditModel',
    data,
    method: 'post'
  })
}
// 添加用户信息
export const addUserInfo = (data) => {
  return axios.request({
    url: 'User/AddUserModel',
    data,
    method: 'post'
  })
}
